#!/user/bin/env python
# -*- coding:utf-8 -*-
#filename:controllers/nums.py

'''
获取uid获取一些统计数据：我的tfeet数量，我评论的数量，我的tfeet被评论的数量，我收藏tfeet数量。

http://tinyfeet.us/i/nums/1231?srckey=234234saeasdfasdfasdf

{"nums":
  [
  	 {
        "tfeets" : 212,
        "mycomments" : 332,
	   "theircomments" : 232,
	   "myfavorite" : 102

 	 }
  ]
}

Created on 2011-8-25

@author: zc
'''

from checkkey import checkkey
from numsjson import numsjson
import web

class nums():
    '''获取tfeet评论内容列表
      http://tinyfeet.us/i/nums/1?srckey=c59a1c31ef4615de72155cb508e491b18f626c8fnhyaotrk
        '''
    
    def GET( self, type ):
        nums = None
        if checkkey( web.config._session, web.ctx.env ):
            tf = numsjson() 
            uid = int( type )
            nums = tf.numsjson( uid )
        else:
            nums = '{"msg":"203", "errmsg":"session验证未通过."}'
        
        return nums
        
